package Demo;

import java.util.concurrent.*;

public class Demo14 {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<Integer> blockingQueue  = new LinkedBlockingQueue<>(10);

        blockingQueue.put(1);
        blockingQueue.put(2);
        int ret = blockingQueue.take();
        System.out.println(ret);
        ret = blockingQueue.poll();
        System.out.println(ret);
        blockingQueue.poll();
        System.out.println(ret);
    }
}
